﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Acc.Lib.Providers;
using Data.UserDb;

namespace Acc_Web.admin
{
    public partial class manageItem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                var sr = new ShopRepository();
                var source = sr.GetAllItems();

                var data = from s in source
                           select new
                                      {
                                          s.ItemId,
                                          s.ItemName,
                                          s.CreateDate,
                                          s.Storage,
                                          SvrType = ActionLoader.GetSrv(s.SrvId).ServName,
                                          s.Price
                                      };
                itemList.DataSource = data;
                itemList.DataBind();
            }
        }
    }
}
